package com.leon.programPeral.ch2.ext3;

import org.junit.Test;

import java.util.Random;

public class WordsUtil
{
	public static String getRandomStr(int count)
	{
		String base = "abcdefghijklmnopqrstuvwxyz0123456789";
		int len = base.length();
		Random random = new Random(0);
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < count; i++)
		{
			int c = random.nextInt(len);
			sb.append(base.charAt(c));
		}
		return sb.toString();
	}
	@Test
	public void test()
	{
		long time = System.currentTimeMillis();
		getRandomStr(1000000);
		System.out.println(System.currentTimeMillis() - time);
		System.out.println(getRandomStr(10));
	}
}
